Skip to content

netvmini/rssv2: fix mixed-width comparison in processor lookup loop#1383

Open
andremueiot wants to merge 1 commit into
microsoft:mainfrom
andremueiot:user/andremueiot/comparison_wider_type
Open

netvmini/rssv2: fix mixed-width comparison in processor lookup loop#1383
andremueiot wants to merge 1 commit into
microsoft:mainfrom
andremueiot:user/andremueiot/comparison_wider_type

Conversation

@andremueiot
Copy link
Copy Markdown

Summary
This PR addresses a static-analysis warning in rssv2.c related to comparing values of different integer widths in a loop condition.

Changes

  • Updated the loop index type in NICSetRSSv2FindProcessorInRssSet from UINT8 to ULONG to match RssProcessorCount width.
  • Added an explicit cast when returning the found index: return (UINT8)index; to preserve the function’s return type and behavior.

Why
Using matching integer widths in loop comparisons avoids analyzer warnings and reduces risk of subtle boundary issues.

Impact
No functional behavior change is intended; this is a type-safety and code-quality fix for warning cleanup.

Summary
This PR addresses a static-analysis warning in rssv2.c related to comparing values of different integer widths in a loop condition.

Changes
- Updated the loop index type in NICSetRSSv2FindProcessorInRssSet from UINT8 to ULONG to match RssProcessorCount width.
- Added an explicit cast when returning the found index: return (UINT8)index; to preserve the function’s return type and behavior.

Why
Using matching integer widths in loop comparisons avoids analyzer warnings and reduces risk of subtle boundary issues.

Impact
No functional behavior change is intended; this is a type-safety and code-quality fix for warning cleanup.
@andremueiot andremueiot requested a review from a team as a code owner May 14, 2026 20:55
@andremueiot
Copy link
Copy Markdown
Author

@5an7y-Microsoft , could you please merge this PR? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants